@datapos/datapos-development 0.3.127 â 0.3.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/datapos-development.es.js +84 -81
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Data Positioning Development Library
|
|
2
2
|
|
|
3
3
|
[](https://sonarcloud.io/summary/new_code?id=data-positioning_datapos-development)
|
|
4
|
+
<span><!-- OWASP_BADGE_START -->[](https://data-positioning.github.io/test-lib/dependency-check-reports/dependency-check-report.html)<!-- OWASP_BADGE_END --></span>
|
|
4
5
|
[](https://www.npmjs.com/package/@datapos/datapos-development)
|
|
5
6
|
[](./LICENSE)
|
|
6
7
|
|
|
@@ -64,9 +65,11 @@ The OWASP Dependency Check Report identifies known vulnerabilities in project de
|
|
|
64
65
|
The following table lists top-level production and peer dependencies only. All dependency licenses (including transitive dependencies) have been recursively verified to conform to Apache-2.0, CC0-1.0, MIT, or n/a. Developers cloning this repository should independently verify dev and optional dependencies; users of the uploaded library are covered by these checks.
|
|
65
66
|
|
|
66
67
|
<!-- DEPENDENCY_LICENSES_START -->
|
|
68
|
+
|
|
67
69
|
| Name | Type | Installed | Latest | Latest Modified |
|
|
68
70
|
| :---------------------- | :--: | :-------: | :-----: | :----------------------- |
|
|
69
71
|
| @datapos/datapos-shared | MIT | 0.3.252 | 0.3.252 | 2025-11-25T16:48:28.532Z |
|
|
72
|
+
|
|
70
73
|
<!-- DEPENDENCY_LICENSES_END -->
|
|
71
74
|
|
|
72
75
|
### Bundle Analysis Report
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { exec as
|
|
1
|
+
import { exec as b } from "node:child_process";
|
|
2
2
|
import { promises as t } from "node:fs";
|
|
3
|
-
import { nanoid as
|
|
4
|
-
import { promisify as
|
|
5
|
-
const
|
|
6
|
-
async function
|
|
3
|
+
import { nanoid as $ } from "nanoid";
|
|
4
|
+
import { promisify as O } from "node:util";
|
|
5
|
+
const S = ["createObject", "dropObject", "removeRecords", "upsertRecords"], v = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"], y = O(b);
|
|
6
|
+
async function k() {
|
|
7
7
|
try {
|
|
8
8
|
console.info("đ Building configuration...");
|
|
9
9
|
const e = JSON.parse(await t.readFile("package.json", "utf8")), o = JSON.parse(await t.readFile("config.json", "utf8"));
|
|
@@ -18,26 +18,26 @@ async function C(e) {
|
|
|
18
18
|
const o = {};
|
|
19
19
|
async function i(s, r) {
|
|
20
20
|
console.info(`âī¸ Processing directory '${s}'...`);
|
|
21
|
-
const d = [],
|
|
22
|
-
o[
|
|
23
|
-
for (const
|
|
24
|
-
const l = `${s}/${
|
|
21
|
+
const d = [], c = s.substring(`public/${e}`.length);
|
|
22
|
+
o[c] = d;
|
|
23
|
+
for (const a of r) {
|
|
24
|
+
const l = `${s}/${a}`;
|
|
25
25
|
try {
|
|
26
26
|
const f = await t.stat(l);
|
|
27
27
|
if (f.isDirectory()) {
|
|
28
|
-
const
|
|
29
|
-
d.push(
|
|
28
|
+
const u = await t.readdir(l), p = { childCount: u.length, name: `${a}`, typeId: "folder" };
|
|
29
|
+
d.push(p), await i(l, u);
|
|
30
30
|
} else {
|
|
31
|
-
const
|
|
32
|
-
d.push(
|
|
31
|
+
const u = { id: $(), lastModifiedAt: f.mtimeMs, name: a, size: f.size, typeId: "object" };
|
|
32
|
+
d.push(u);
|
|
33
33
|
}
|
|
34
34
|
} catch (f) {
|
|
35
|
-
throw new Error(`Unable to get information for '${
|
|
35
|
+
throw new Error(`Unable to get information for '${a}' in 'buildPublicDirectoryIndex'. ${String(f)}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
d.sort((
|
|
39
|
-
const f =
|
|
40
|
-
return f === 0 ?
|
|
38
|
+
d.sort((a, l) => {
|
|
39
|
+
const f = a.typeId.localeCompare(l.typeId);
|
|
40
|
+
return f === 0 ? a.name.localeCompare(l.name) : f;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
const n = await t.readdir(`public/${e}`);
|
|
@@ -46,23 +46,23 @@ async function C(e) {
|
|
|
46
46
|
console.error("â Error building public directory index.", o);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
async function
|
|
49
|
+
async function J() {
|
|
50
50
|
try {
|
|
51
51
|
console.info("đ Building connector configuration...");
|
|
52
52
|
const e = JSON.parse(await t.readFile("package.json", "utf8")), o = JSON.parse(await t.readFile("config.json", "utf8")), i = await t.readFile("src/index.ts", "utf8");
|
|
53
53
|
let n = !1, s = !1;
|
|
54
|
-
const r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, d = [...i.matchAll(r)].filter((
|
|
55
|
-
const l =
|
|
56
|
-
return n = n ||
|
|
54
|
+
const r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, d = [...i.matchAll(r)].filter((a) => a[1] == null && a[2] !== "constructor").map((a) => {
|
|
55
|
+
const l = a[2];
|
|
56
|
+
return n = n || S.includes(l), s = s || v.includes(l), l;
|
|
57
57
|
});
|
|
58
58
|
d.length > 0 ? console.info(`âšī¸ Implements ${d.length} operations.`) : console.warn("â ī¸ Implements no operations.");
|
|
59
|
-
const
|
|
60
|
-
|
|
59
|
+
const c = s && n ? "bidirectional" : s ? "source" : n ? "destination" : "unknown";
|
|
60
|
+
c && console.info(`âšī¸ Supports ${c} usage.`), e.name != null && (o.id = e.name), o.operations = d, o.usageId = c, e.version != null && (o.version = e.version), await t.writeFile("config.json", JSON.stringify(o, void 0, 4), "utf8"), console.info("â
Connector configuration built.");
|
|
61
61
|
} catch (e) {
|
|
62
62
|
console.error("â Error building connector configuration.", e);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
async function
|
|
65
|
+
async function A() {
|
|
66
66
|
try {
|
|
67
67
|
console.info("đ Building context configuration...");
|
|
68
68
|
const e = JSON.parse(await t.readFile("package.json", "utf8")), o = JSON.parse(await t.readFile("config.json", "utf8")), i = await t.readFile("src/index.ts", "utf8"), n = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...i.matchAll(n)].filter((r) => r[1] == null && r[2] !== "constructor").map((r) => r[2]);
|
|
@@ -71,7 +71,7 @@ async function J() {
|
|
|
71
71
|
console.error("â Error building context configuration.", e);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
async function
|
|
74
|
+
async function F() {
|
|
75
75
|
try {
|
|
76
76
|
console.info("đ Building presenter configuration...");
|
|
77
77
|
const e = JSON.parse(await t.readFile("package.json", "utf8")), o = JSON.parse(await t.readFile("config.json", "utf8")), i = await t.readFile("src/index.ts", "utf8"), n = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...i.matchAll(n)].filter((r) => !r[1] && r[2] !== "constructor").map((r) => r[2]);
|
|
@@ -80,7 +80,7 @@ async function R() {
|
|
|
80
80
|
console.error("â Error building context configuration.", e);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
async function
|
|
83
|
+
async function R(e = "./") {
|
|
84
84
|
try {
|
|
85
85
|
console.info("đ Bumping version...");
|
|
86
86
|
const o = JSON.parse(await t.readFile(`${e}package.json`, "utf8"));
|
|
@@ -94,10 +94,10 @@ async function A(e = "./") {
|
|
|
94
94
|
console.error("â Error bumping package version.", o);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function D(e) {
|
|
98
98
|
console.error(`â ${e} script not implemented.`);
|
|
99
99
|
}
|
|
100
|
-
async function
|
|
100
|
+
async function P() {
|
|
101
101
|
const e = "<!-- DEPENDENCY_LICENSES_START -->", o = "<!-- DEPENDENCY_LICENSES_END -->";
|
|
102
102
|
try {
|
|
103
103
|
const i = (await t.readFile("./licenses.md", "utf8")).trim(), n = await t.readFile("./README.md", "utf8"), s = n.indexOf(e), r = n.indexOf(o);
|
|
@@ -114,37 +114,40 @@ async function I() {
|
|
|
114
114
|
const e = "<!-- OWASP_BADGE_START -->", o = "<!-- OWASP_BADGE_END -->";
|
|
115
115
|
try {
|
|
116
116
|
const i = JSON.parse(await t.readFile("./dependency-check-reports/dependency-check-report.json", "utf-8")), n = { critical: 0, high: 0, moderate: 0, low: 0, unknown: 0 };
|
|
117
|
-
for (const
|
|
118
|
-
if (
|
|
119
|
-
for (const
|
|
120
|
-
const
|
|
121
|
-
|
|
117
|
+
for (const g of i.dependencies)
|
|
118
|
+
if (g.vulnerabilities != null)
|
|
119
|
+
for (const m of g.vulnerabilities) {
|
|
120
|
+
const w = m.severity?.toLowerCase() ?? "unknown";
|
|
121
|
+
w in n ? n[w]++ : n.unknown++;
|
|
122
122
|
}
|
|
123
123
|
const s = {
|
|
124
|
-
critical: { color: "
|
|
125
|
-
high: { color: "
|
|
126
|
-
moderate: { color: "
|
|
127
|
-
low: { color: "
|
|
128
|
-
unknown: { color: "
|
|
129
|
-
}, r =
|
|
130
|
-
|
|
131
|
-
if (g === 0) continue;
|
|
132
|
-
const m = s[u], y = `https://img.shields.io/badge/OWASP%20${m.label}-${g}-${m.color}`;
|
|
133
|
-
r.push(`[](./dependency-check-reports/dependency-check-report.html)`);
|
|
134
|
-
}
|
|
135
|
-
const d = Object.values(n).reduce((u, g) => u + g, 0);
|
|
136
|
-
console.info(`â
Total vulnerabilities found: ${d}`), console.info(
|
|
124
|
+
critical: { color: "D32F2F", label: "critical" },
|
|
125
|
+
high: { color: "EF6C00", label: "high" },
|
|
126
|
+
moderate: { color: "F9A825", label: "moderate" },
|
|
127
|
+
low: { color: "AFB42B", label: "low" },
|
|
128
|
+
unknown: { color: "757575", label: "unknown" }
|
|
129
|
+
}, r = Object.values(n).reduce((g, m) => g + m, 0);
|
|
130
|
+
console.info(`â
Total vulnerabilities found: ${r}`), console.info(
|
|
137
131
|
` Critical: ${n.critical}, High: ${n.high}, Moderate: ${n.moderate}, Low: ${n.low}, Unknown: ${n.unknown}`
|
|
138
132
|
);
|
|
139
|
-
const
|
|
140
|
-
(
|
|
141
|
-
|
|
133
|
+
const d = JSON.parse(await t.readFile("config.json", "utf8")), c = [];
|
|
134
|
+
if (r === 0)
|
|
135
|
+
c.push(`[](https://data-positioning.github.io/${d.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
136
|
+
else
|
|
137
|
+
for (const [g, m] of Object.entries(n)) {
|
|
138
|
+
if (m === 0) continue;
|
|
139
|
+
const w = s[g], h = `https://img.shields.io/badge/OWASP-${m}%20${w.label}-${w.color}`;
|
|
140
|
+
c.push(`[](https://data-positioning.github.io/${d.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
141
|
+
}
|
|
142
|
+
const a = await t.readFile("./README.md", "utf8"), l = a.indexOf(e), f = a.indexOf(o);
|
|
143
|
+
(l === -1 || f === -1) && (console.error("â OWASP badge markers not found in README.md."), process.exit(1));
|
|
144
|
+
const u = c.join(" "), p = a.substring(0, l + e.length) + u + a.substring(f);
|
|
142
145
|
await t.writeFile("README.md", p, "utf8"), console.info("â
OWASP dependency check badges inserted into README.md");
|
|
143
146
|
} catch (i) {
|
|
144
147
|
console.error("â Error updating README with OWASP badges:", i), process.exit(1);
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
|
-
async function
|
|
150
|
+
async function M() {
|
|
148
151
|
try {
|
|
149
152
|
console.info("đ Sending deployment notice...");
|
|
150
153
|
const e = JSON.parse(await t.readFile("config.json", "utf8")), o = {
|
|
@@ -158,28 +161,28 @@ async function P() {
|
|
|
158
161
|
console.error("â Error sending deployment notice.", e);
|
|
159
162
|
}
|
|
160
163
|
}
|
|
161
|
-
async function
|
|
164
|
+
async function T() {
|
|
162
165
|
try {
|
|
163
166
|
console.info("đ Synchronising with GitHub....");
|
|
164
167
|
const e = JSON.parse(await t.readFile("package.json", "utf8"));
|
|
165
|
-
await
|
|
168
|
+
await y("git add ."), await y(`git commit -m "v${e.version}"`), await y("git push origin main:main"), console.info(`â
Synchronised version ${e.version} with GitHub.`);
|
|
166
169
|
} catch (e) {
|
|
167
170
|
console.error("â Error synchronising with GitHub.", e);
|
|
168
171
|
}
|
|
169
172
|
}
|
|
170
|
-
async function
|
|
173
|
+
async function _(e, o) {
|
|
171
174
|
try {
|
|
172
175
|
console.info("đ Uploading directory to R2....");
|
|
173
176
|
async function i(s, r, d) {
|
|
174
|
-
for (const
|
|
175
|
-
const
|
|
176
|
-
if ((await t.stat(
|
|
177
|
-
const
|
|
178
|
-
await i(
|
|
177
|
+
for (const c of d) {
|
|
178
|
+
const a = `${s}/${c}`, l = `${r}/${c}`;
|
|
179
|
+
if ((await t.stat(a)).isDirectory()) {
|
|
180
|
+
const u = await t.readdir(a);
|
|
181
|
+
await i(a, l, u);
|
|
179
182
|
} else {
|
|
180
|
-
console.info(`âī¸ Uploading '${s}/${
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
183
|
+
console.info(`âī¸ Uploading '${s}/${c}'...`);
|
|
184
|
+
const u = `wrangler r2 object put "datapos-sample-data-eu/${r}/${c}" --file="${s}/${c}" --jurisdiction=eu --remote`, p = await y(u);
|
|
185
|
+
if (p.stderr) throw new Error(p.stderr);
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
188
|
}
|
|
@@ -189,7 +192,7 @@ async function T(e, o) {
|
|
|
189
192
|
console.error("â Error uploading directory to R2.", i);
|
|
190
193
|
}
|
|
191
194
|
}
|
|
192
|
-
async function
|
|
195
|
+
async function W() {
|
|
193
196
|
try {
|
|
194
197
|
console.info("đ Uploading module configuration....");
|
|
195
198
|
const e = JSON.parse(await t.readFile("config.json", "utf8")), o = e.id, i = {
|
|
@@ -203,19 +206,19 @@ async function _() {
|
|
|
203
206
|
console.error("â Error uploading module configuration.", e);
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
|
-
async function
|
|
209
|
+
async function B(e) {
|
|
207
210
|
try {
|
|
208
211
|
console.info("đ Uploading module to R2...");
|
|
209
212
|
const i = `v${JSON.parse(await t.readFile("package.json", "utf8")).version}`;
|
|
210
213
|
async function n(s, r = "") {
|
|
211
214
|
const d = await t.readdir(s, { withFileTypes: !0 });
|
|
212
|
-
for (const
|
|
213
|
-
const
|
|
214
|
-
if (!
|
|
215
|
-
const f = `${e}_${i}/${l}`.replace(/\\/g, "/"),
|
|
215
|
+
for (const c of d) {
|
|
216
|
+
const a = `${s}/${c.name}`, l = r ? `${r}/${c.name}` : c.name;
|
|
217
|
+
if (!c.isDirectory()) {
|
|
218
|
+
const f = `${e}_${i}/${l}`.replace(/\\/g, "/"), u = c.name.endsWith(".js") ? "application/javascript" : c.name.endsWith(".css") ? "text/css" : "application/octet-stream";
|
|
216
219
|
console.info(`âī¸ Uploading '${l}' â '${f}'...`);
|
|
217
|
-
const { stderr:
|
|
218
|
-
if (
|
|
220
|
+
const { stderr: p } = await y(`wrangler r2 object put "${f}" --file="${a}" --content-type ${u} --jurisdiction=eu --remote`);
|
|
221
|
+
if (p) throw new Error(p);
|
|
219
222
|
}
|
|
220
223
|
}
|
|
221
224
|
}
|
|
@@ -225,18 +228,18 @@ async function U(e) {
|
|
|
225
228
|
}
|
|
226
229
|
}
|
|
227
230
|
export {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
k as buildConfig,
|
|
232
|
+
J as buildConnectorConfig,
|
|
233
|
+
A as buildContextConfig,
|
|
234
|
+
F as buildPresenterConfig,
|
|
232
235
|
C as buildPublicDirectoryIndex,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
+
R as bumpVersion,
|
|
237
|
+
D as echoScriptNotImplemented,
|
|
238
|
+
P as insertLicensesIntoReadme,
|
|
236
239
|
I as insertOWASPDependencyCheckBadgeIntoReadme,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
M as sendDeploymentNotice,
|
|
241
|
+
T as syncWithGitHub,
|
|
242
|
+
_ as uploadDirectoryToR2,
|
|
243
|
+
W as uploadModuleConfigToDO,
|
|
244
|
+
B as uploadModuleToR2
|
|
242
245
|
};
|
package/package.json
CHANGED